package com.coocaa.ops.admin.v1.dict.service;

import com.coocaa.ops.admin.v1.dict.provider.DictInfoQueryProviderImpl;
import com.coocaa.ops.admin.v1.dict.util.DictUtil;
import com.coocaa.ops.common.core.biz.dict.entity.DictInfoEntity;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.PostConstruct;
import java.util.List;

/**
 * @Author : bijiahao
 * @Date : 2018/4/23.
 * @Description: 数据字典-服务实现类
 * <p> </p>
 */

@Service
public class DictInfoQueryServiceImpl implements IDictInfoQueryService {

    @Autowired
    private DictInfoQueryProviderImpl dictInfoQueryProvider;

    /**
     * 通过分类查询列表信息
     *
     * @param category
     * @return
     */
    @Override
    public List<DictInfoEntity> queryByCategory(String category) {
        return dictInfoQueryProvider.queryByCategory(category);
    }

    /**
     * 初始化设置
     */
    @PostConstruct
    private void init() {
        DictUtil.setDictInfoQueryService(this);
    }
}
